package dry.example.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author zc
 */
@Component
public class EventListenerDemo implements ApplicationListener<CustomEvent> {

    @Override
    public void onApplicationEvent(CustomEvent event) {
        System.out.println("event.getSource()=" + event.getSource());
        System.out.println("event.getMessage()=" + event.getMessage());
        System.out.println("event.getTimestamp()=" + event.getTimestamp());
    }

}
